<template>
  <div class="load">
      <div class="btn" v-if="loadType == 1" @click="moreList">加载更多</div>
      <div class="text" v-if="loadType == 2">没有更多了~~</div>
      <div class="loading" v-if="loadType == 3">
          <div class="circle"></div>
          <div class="circle"></div>
          <div class="circle"></div>
          <div class="circle"></div>
          <div class="circle"></div>
      </div>
  </div>
</template>

<script>
import { onMounted } from 'vue'
export default {
    props: {
        loadType: Number
    },
    emits: ['getList'],
    setup(props, context) {
        const moreList = () => {
            context.emit('getList')
        }
        return {
            moreList
        }
    }
}
</script>

<style scoped lang="scss">
.load{
    margin-top: 40px;
    display: flex;
    justify-content: center;
    font-size: 12px;
    .btn{
        border: 1px solid #e6e6e6;
        padding: 8px 30px;
        border-radius: 10px;
        cursor: pointer;
        &:hover{
            color: #ffffff;
            background-color: #01c5c4;
        }
    }
    .text{
        color: #bbbbbb;
    }
    .loading{
        width: 100px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .circle{
            width: 10px;
            height: 10px;
            border-radius: 50%;
            animation: change 1s infinite;
            &:nth-child(1){
                background-color: #ffdada;
                animation-delay: 0.1s;
            }
            &:nth-child(2){
                background-color: #fae0df;
                animation-delay: 0.2s;
            }
            &:nth-child(3){
                background-color: #fdcfdf;
                animation-delay: 0.3s;
            }
            &:nth-child(4){
                background-color: #fbbedf;
                animation-delay: 0.4s;
            }
            &:nth-child(5){
                background-color: #fca3cc;
                animation-delay: 0.5s;
            }
            @keyframes change {
                0% {
                    transform: scale(1);
                }
                50% {
                    transform: scale(1.5);
                }
                100% {
                    transform:  scale(1);
                }
            }
        }
    }
}
</style>